"""
@author: yjx
@file: 05.统计list.py
@time: 2023/4/20 16:10
"""

# 统计list中整数类型的数值和（list中可能有其他类型，只需要整数类型）

lst = [1, 2, 3, "str", {"name": "value"}]
sum = 0
for i in lst:
    # if type(i) == int:
    # if x % 1 == 0:
    if isinstance(i, int):
        # print(f"{i} is an integer")
        sum += i
print(sum)
